/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.garethc.chpt2.bmicalc.bmicalc.impl;

import za.ac.cput.garethc.chpt2.bmicalc.bmicalc.BMICalc;


/**
 *
 * @author Gareth
 */
public class BMICalcImpl implements BMICalc
{

    @Override
    public double calcBMI(double w, double h) 
    {
        return w/(h*h);
    }

    @Override
    public String bmiCategory(double b) 
    {
        if (b < 18.5)
            return ("Underweight");
        else if (b < 25)
            return ("Normal Weight");
        else if (b < 30)
            return ("Overweight");
        else if (b > 30)
            return ("Obese");
        
        return "default";
    }
    
}
